package chen.dev.learn;

import chen.dev.learn.service.SpaService;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.context.ApplicationPidFileWriter;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * 服务主入口
 *
 * @author chensj
 * @date 2020-04-20 20:41
 */
@SpringBootApplication
public class AopTheoryApplication {
    public static void main(String[] args) {
        //SpringApplication application = new SpringApplication(AopTheoryApplication.class);
        //application.addListeners(new ApplicationPidFileWriter());
        //ApplicationContext applicationContext = application.run(args);
        //SpaService spa = applicationContext.getBean(SpaService.class);
        ApplicationContext context = SpringApplication.run(AopTheoryApplication.class, args);
        SpaService spa = context.getBean(SpaService.class);
        spa.aromaOilMassage("Mike");
        spa.aromaOilMassage("Tony");
        spa.aromaOilMassage("Allen");
    }

}
